import { getSign , buildQuery } from "../tools/util"

import host from "../config/host"

function goodsList(callback)
{
    let url = host.host + '/api/goods/list';

    fetch(url, {
        method: 'GET',
        headers: {'content-Type': 'application/x-www-form-urlencoded'},
    })
        .then(function(res) {
            console.log('receive res: ', res);
            if(res.ok){
                let result =  res.json();
                console.log("res.json() : ", result);
                return result;
            } else {
                throw "服务器出错了";
            }
        })
        .then(function(json) {
            callback(json)
        })
        .catch(function(err) {

        });
}

export {
    goodsList
}